let arr1 = [1,2,3,1,2];
let arr2 = [4,5,6,2,4,7];
//交集
let newArr=arr1.filter(item=>{
    return arr2.includes(item);
})

console.log(newArr)

//[2,2]
//并集
let temp=[...arr1,...arr2];
console.log(...new Set([...arr1,...arr2]))
//[1,2,3,4,5,6]
